/**
 * 
 */

package com.wutianyi.nio.interfaces.impl;

import com.wutianyi.nio.interfaces.InputHandler;
import com.wutianyi.nio.interfaces.InputHandlerFactory;

/**
 * @author wutianyi
 * 
 */
public class GenericInputHandlerFactory implements InputHandlerFactory {

	private final Class<? extends InputHandler>	handlerClass;

	public GenericInputHandlerFactory(Class<? extends InputHandler> handlerClass) {

		this.handlerClass = handlerClass;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.wutianyi.nio.interfaces.InputHandlerFactory#newHandler()
	 */
	@Override
	public InputHandler newHandler() throws IllegalAccessException, InstantiationException {

		return handlerClass.newInstance();
	}

}
